If set to TRUE, does not call the free func for the removed items.
This can be used to move items between arrays without having to do the
refcounting dance.
gdk_array(splice) (GdkArray *self,
gsize pos,
gsize removed,
+ gboolean stolen,
_T_ *additions,
gsize added)
{
g_assert (pos + removed <= size);
remaining = size - pos - removed;
- gdk_array(free_elements) (gdk_array(index) (self, pos),
- gdk_array(index) (self, pos + removed));
+ if (!stolen)
+ gdk_array(free_elements) (gdk_array(index) (self, pos),
+ gdk_array(index) (self, pos + removed));
gdk_array(reserve) (self, size - removed + added);
{
gsize old_size = gdk_array(get_size) (self);
if (new_size > old_size)
- gdk_array(splice) (self, old_size, 0, NULL, new_size - old_size);
+ gdk_array(splice) (self, old_size, 0, FALSE, NULL, new_size - old_size);
else
- gdk_array(splice) (self, new_size, old_size - new_size, NULL, 0);
+ gdk_array(splice) (self, new_size, old_size - new_size, FALSE, NULL, 0);
}
G_GNUC_UNUSED static void
gdk_array(splice) (self,
gdk_array(get_size) (self),
0,
+ FALSE,
#ifdef GDK_ARRAY_BY_VALUE
value,
#else
position = gtk_accels_find (accels, action_and_target);
if (position < gtk_accels_get_size (accels))
- gtk_accels_splice (accels, position, 1, NULL, 0);
+ gtk_accels_splice (accels, position, 1, FALSE, NULL, 0);
}
/*< private >
break;
}
- gtk_css_selector_matches_splice (matches, i, 0, (gpointer[1]) { data }, 1);
+ gtk_css_selector_matches_splice (matches, i, 0, FALSE, (gpointer[1]) { data }, 1);
}
static inline gboolean
filter = gtk_filters_get (&self->filters, position);
g_signal_handlers_disconnect_by_func (filter, gtk_multi_filter_changed_cb, self);
- gtk_filters_splice (&self->filters, position, 1, NULL, 0);
+ gtk_filters_splice (&self->filters, position, 1, FALSE, NULL, 0);
gtk_filter_changed (GTK_FILTER (self),
GTK_MULTI_FILTER_GET_CLASS (self)->removal_change);
sorter = gtk_sorters_get (&self->sorters, position);
g_signal_handlers_disconnect_by_func (sorter, gtk_multi_sorter_changed_cb, self);
- gtk_sorters_splice (&self->sorters, position, 1, NULL, 0);
+ gtk_sorters_splice (&self->sorters, position, 1, FALSE, NULL, 0);
gtk_sorter_changed_with_keys (GTK_SORTER (self),
GTK_SORTER_CHANGE_LESS_STRICT,
/* Remove all the state's nodes from the list of nodes */
g_assert (state->start_node_index + state->n_nodes == gtk_snapshot_nodes_get_size (&snapshot->nodes));
- gtk_snapshot_nodes_splice (&snapshot->nodes, state->start_node_index, state->n_nodes, NULL, 0);
+ gtk_snapshot_nodes_splice (&snapshot->nodes, state->start_node_index, state->n_nodes, FALSE, NULL, 0);
}
else
{
g_assert (previous_state->start_node_index + previous_state->n_nodes == gtk_snapshot_nodes_get_size (&snapshot->nodes));
}
- gtk_snapshot_states_splice (&snapshot->state_stack, state_index, 1, NULL, 0);
+ gtk_snapshot_states_splice (&snapshot->state_stack, state_index, 1, FALSE, NULL, 0);
return node;
}
else
n_additions = 0;
- objects_splice (&self->items, position, n_removals, NULL, n_additions);
+ objects_splice (&self->items, position, n_removals, FALSE, NULL, n_additions);
for (i = 0; i < n_additions; i++)
{
for (j = 0; j < add; j++)
sum += ++additions[j];
- gdk_array(splice) (&v, pos, remove, additions, add);
+ gdk_array(splice) (&v, pos, remove, FALSE, additions, add);
{
gsize total = 0;
for (j = 0; j < gdk_array(get_size) (&v); j++)